package org.xdq.demo.dao.security;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import org.xdq.demo.model.Role;
import org.xdq.demo.vo.MenuVo;

import java.util.List;
import java.util.Map;

public interface RoleDao {


    @Select("select * from t_role")
    public List<Role> findRoleList();


    List<MenuVo> findMenuVoList();

    @Select("select f_id from t_rf where ro_id = #{roId}")
    List<Integer> findRoleMenuIdList(Integer roId);

    @Delete("delete from t_rf where ro_id = #{ro_id}")
    void deleteRoleFun(Map<String, Object> map);

    void insertRoleFun(Map<String, Object> map);

    @Select("select ifnull(max(ro_id),0) from t_role")
    int findMaxId();

    @Insert("insert into t_role(ro_id,ro_name) values(#{ro_id},#{ro_name})")
    void insertRole(Map<String, Object> dto);
}
